It is known in the art that the outputs of a digital camera sensor have some non-zero level even in the case when no light reaches the sensor surface. This non-zero level is caused, for example, by dark current that accumulates electrical charges into the pixels independently of the amount of light that reaches the sensor surface. The dark current usually increases with temperature. The total amount of accumulated charges also increases as a function of exposure time and the final output signal from the camera sensor may also be affected by the analog gain of the camera. This non-zero level in the sensor outputs is also known as the black level. Typically there is circuitry in the camera sensor to normalize the black level at some pre-determined fixed level. Unfortunately in many cases there remains some difference between the target level and actual level. In order to produce correct colors and intensity levels in the final image, it is necessary to determine a more accurate black level so that it can be removed from the raw data.